REQUIRES: lld, system-windows

RUN: %build -n --verbose --arch=32 --compiler=clang-cl --mode=compile-and-link -o %t/foo.exe foobar.c \
RUN:    | FileCheck --check-prefix=CHECK-32 %s

RUN: %build -n --verbose --arch=64 --compiler=clang-cl --mode=compile-and-link -o %t/foo.exe foobar.c \
RUN:    | FileCheck --check-prefix=CHECK-64 %s

CHECK-32: Script Arguments:
CHECK-32:   Arch: 32
CHECK-32:   Compiler: clang-cl
CHECK-32:   Outdir: {{.*}}
CHECK-32:   Output: {{.*}}toolchain-clang-cl.test.tmp\foo.exe
CHECK-32:   Nodefaultlib: False
CHECK-32:   Opt: none
CHECK-32:   Mode: compile
CHECK-32:   Clean: True
CHECK-32:   Verbose: True
CHECK-32:   Dryrun: True
CHECK-32:   Inputs: foobar.c
CHECK-32: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foobar.ilk
CHECK-32: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.exe-foobar.obj
CHECK-32: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.pdb
CHECK-32: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.exe
CHECK-32: compiling foobar.c -> foo.exe-foobar.obj
CHECK-32: {{.*}}clang-cl{{(\.EXE)?}} -m32
CHECK-32: linking foo.exe-foobar.obj -> foo.exe
CHECK-32: {{.*}}lld-link{{(\.EXE)?}}

CHECK-64: Script Arguments:
CHECK-64:   Arch: 64
CHECK-64:   Compiler: clang-cl
CHECK-64:   Outdir: {{.*}}
CHECK-64:   Output: {{.*}}toolchain-clang-cl.test.tmp\foo.exe
CHECK-64:   Nodefaultlib: False
CHECK-64:   Opt: none
CHECK-64:   Mode: compile
CHECK-64:   Clean: True
CHECK-64:   Verbose: True
CHECK-64:   Dryrun: True
CHECK-64:   Inputs: foobar.c
CHECK-64: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foobar.ilk
CHECK-64: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.exe-foobar.obj
CHECK-64: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.pdb
CHECK-64: Cleaning {{.*}}toolchain-clang-cl.test.tmp{{.}}foo.exe
CHECK-64: compiling foobar.c -> foo.exe-foobar.obj
CHECK-64: {{.*}}clang-cl{{(\.EXE)?}} -m64
CHECK-64: linking foo.exe-foobar.obj -> foo.exe
CHECK-64: {{.*}}lld-link{{(\.EXE)?}}
